import request from '@/utils/request'
const path = 'http://39.108.248.115:9000'
const api = {
    stores: path + '/budget/stores'
}
// 门店查询
export function getStores (parameter) {
    const par = '?storeName=' + parameter.storeName
    return request({
        url: api.stores + par,
        method: 'get'
    })
}

// 新增门店
export function addStores (parameter) {
    return request({
        url: api.stores,
        method: 'post',
        data: parameter
    })
}

// 更新门店
export function editStores (parameter) {
    return request({
        url: api.stores + '/' + parameter.storeId,
        method: 'put',
        data: parameter
    })
}

// 门店的当事人信息
export function getMaintenances (storeId) {
    return request({
        url: api.stores + '/' + storeId + '/maintenances',
        method: 'get'
    })
}

// 当事人维护门店
export function maintenancesStores (parameter) {
    return request({
        url: api.stores + '/' + parameter.storeId + '/maintenances',
        method: 'post',
        data: parameter
    })
}
